import store from '@/store'

export default {
  /**
   * inserted 被绑定元素插入父节点时候调用
   * el  指令v-bin-key 绑定的元素 用来操作dom
   * binding.value  指令v-bin-key 绑定的值
   */
  inserted(el, binding, vnode) {
    //const binKey = store.getters && store.getters.binKey
    let Key = binding.value
    let binKeys = store.getters.binKey ? store.getters.binKey : [];
    let index = binKeys.indexOf(Key)
    //找不到值删除按钮
    index === -1 && el.remove()
  }
}
